package com.monster.controller;

import com.monster.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * description:
 *
 * @author Yuanml on 2021/1/9 14:24
 */
@Controller
@RequestMapping("/index")
public class IndexController {
    @Resource
    private UserService userService;
    @RequestMapping(value = "/login.do", method = RequestMethod.GET)
    public String login(String username, String password, Model model) {
        System.out.println("------------------>IndexController");
        model.addAttribute("result", userService.login(username, password));
        return "result";
    }
}
